<?php

/**
 * Maikuro CMS
 *
 * LICENSE:
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * The license is bundled with this package in the file LICENSE.txt.
 * You may also obtain a copy of the License at this URL:
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @copyright  Copyright (c) 2010, Jonathan Hedrén
 * @author     Jonathan Hedrén <jonathan.hedren@gmail.com>
 * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
 */

?>

<h1><?php echo $title; ?></h1>

<form action="" method="post" id="site-form">
    <div class="container">
        <fieldset>
            <legend><?php echo Translator::translate('Site data'); ?></legend>

            <?php HtmlBinder::hiddenFor($model->site, 'id'); ?>
            <div class="field text">
                <?php
                    HtmlBinder::labelFor($model->site, 'name');
                    HtmlBinder::textBoxFor($model->site, 'name');
                    HtmlBinder::validationMessagesFor($model->site, 'name');
                ?>
            </div>
            <div class="field text">
                <?php
                    HtmlBinder::labelFor($model->site, 'code');
                    HtmlBinder::textBoxFor($model->site, 'code');
                    HtmlBinder::validationMessagesFor($model->site, 'code');
                ?>
            </div>
            <div class="field text">
                <?php
                    HtmlBinder::labelFor($model->site, 'url');
                    HtmlBinder::textBoxFor($model->site, 'url');
                    HtmlBinder::validationMessagesFor($model->site, 'url');
                ?>
            </div>
            <div class="field select">
                <?php
                    HtmlBinder::labelFor($model->site, 'timezone');
                    HtmlBinder::selectFor($model->site, 'timezone', $model->timezones);
                    HtmlBinder::validationMessagesFor($model->site, 'timezone');
                ?>
            </div>
            <div class="field select">
                <?php
                    HtmlBinder::labelFor($model->site, 'theme');
                    HtmlBinder::selectFor($model->site, 'theme', $model->themes);
                    HtmlBinder::validationMessagesFor($model->site, 'theme');
                ?>
            </div>
        </fieldset>
    </div>
    <?php $this->renderSnippet('customFieldsFormPart', array('customFields' => $model->site->customFields)); ?>
    <div class="actions container">
        <input type="submit" class="neutral-action" name="cancel" value="<?php echo Translator::translate('Cancel'); ?>" />
        <input type="submit" class="positive-action" name="save" value="<?php echo Translator::translate('Save'); ?>" />
    </div>
</form>
